#include "mini.kit.h"
#include <stdio.h>
#include <stdlib.h>
#include <iostream>

int32_t main(int32_t argc, char* argv[])
{
	if(argc<2)
	{
		fprintf(stderr,"usage: %s token value\n", argv[0]);
		fprintf(stderr,"example: %s {name} \"Moomin\"\n", argv[0]);
		return 1;
	}
	
	char buff[4096];
	std::string sLine;
	while(!std::cin.eof())
	{
		std::cin.getline(buff, sizeof(buff));
		sLine = buff;
		MINIKIT::Text::replace( sLine, argv[1], argv[2] );
		std::cout << sLine; 
		if( !sLine.empty() ) std::cout<<std::endl;
	}
	return 0;
}

